package com.dkcd.chenshiproject.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.PointF;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.dkcd.chenshiproject.R;
import com.dkcd.chenshiproject.entity.Song;
import com.dkcd.chenshiproject.util.ArtworkUtils;

import java.io.Serializable;

public class SongBannerImageActivity extends Activity{

    private ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_song_banner_image);
        init();
        initView();

    }

    private void init(){
        imageView = (ImageView) findViewById(R.id.my_image_view);
    }

    private void initView(){
        Song song = (Song) getIntent().getExtras().getSerializable("song");
        Bitmap artwork = ArtworkUtils.getArtwork(this, song.song,
                Long.parseLong(song.songId), Long.parseLong(song.albumId), true);
        imageView.setImageBitmap(artwork);
    }

}